<?php

/**
 * HistoryModel
 *  
 * @author Nguyen Hai Ha
 * @version 
 */

class HistoryModel {
	/**
	 * The default table name 
	 */
	protected $_name = 'eway_coin_history';
	protected $_dbAdapter;
	
	function HistoryModel(){
		$this->_dbAdapter = Zend_Registry::get(Constant::DB_ADAPTER);
	}
		
	public function getHistoryByAccount($account_id){
		$sql = "SELECT * FROM " .$this->_name . " WHERE his_user=? ORDER BY his_time DESC";
		$result = $this->_dbAdapter->fetchAll($sql, $account_id);
		return $result;
	}
	
	public function insert($his=array()){
		$this->_dbAdapter->insert($this->_name, $his);
	}	

}
